<template>
  <div class="app-container">
    <iFrame :src="src"></iFrame>

  </div>
</template>

<script>
  import iFrame from "@/components/iFrame"
  export default {
    name: "PdfView",
    components: {
      iFrame
    },
    computed: {},
    data() {
      return {
        src: '',
        baseUrl: process.env.VUE_APP_BASE_API,
      }
    },
    created() {
      const src = this.$route.params && this.$route.params.src;
      const zltm = this.$route.params && this.$route.params.zltm;
      this.$nextTick(() => {
        let visitedViews = this.$store.state.tagsView.visitedViews;
        visitedViews.some(v => {
          if (v.path == this.$route.path) {
            v.title = zltm;
          }
        })

      });

      if ((src.indexOf(this.baseUrl) === -1) & src.indexOf('http') === -1) {
        this.src = this.baseUrl + 'printtemp/' + src;
      } else {
        this.src = src;
      }

    },
    destroyed() {


    },
    mounted() {

    },
    methods: {

      // prohibit() {

      //   document.oncontextmenu = function() {
      //     return false
      //   }
      //   document.onkeydown = function(e) {
      //     if (e.ctrlKey && (e.keyCode === 65 || e.keyCode === 67 || e.keyCode === 73 || e.keyCode === 74 || e
      //         .keyCode === 80 || e.keyCode === 83 || e.keyCode === 85 || e.keyCode === 86 || e.keyCode === 117)) {
      //       return false
      //     }
      //     if (e.keyCode === 18 || e.keyCode === 123) {
      //       return false
      //     }
      //   }
      // }

    }
  }
</script>

<style scoped>

</style>
